import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

export default async function a003(fd: IFeidaoAiBrowserComponent, e: Event) {
	// todo
	const d = e.currentTarget as HTMLDivElement;
	const no = d.getAttribute("data-v");


	const n1 = fd.data.node.querySelectorAll<HTMLElement>('[data-id="show"]');
	const n2 = fd.data.node.querySelectorAll<HTMLDivElement>('[data-id="more"]');
	const ns1 = Array.from(n1) as HTMLImageElement[];
	const ns2 = Array.from(n2) as HTMLDivElement[];
	ns1.forEach((v) => {
		const t = v.getAttribute('data-v');
		const flag = v.getAttribute('flag');
		if (t === no && flag === "xia") {
			v.setAttribute('class', "iconfont cursor-p icon-shang display-ib fr font22 vertical-a-m");
			v.setAttribute('flag', "shang");
		}
		if (t === no && flag === "shang") {
			v.setAttribute('class', "iconfont cursor-p icon-xia display-ib fr font22 vertical-a-m");
			v.setAttribute('flag', "xia");
		}
	});
	ns2.forEach((v) => {
		const t = v.getAttribute('data-v');
		const flag = v.getAttribute('flag');
		if (t === no && flag === "yes") {
			v.setAttribute('class', "pos-r overflow-h bg-f display-n");
			v.setAttribute('flag', "no");
		}
		if (t === no && flag === "no") {
			v.setAttribute('class', "pos-r overflow-h bg-f display-");
			v.setAttribute('flag', "yes");
		}
	});



}
